<?php

namespace system\core;

function cache($key, $val=null)
{
	if( isset($val) )
	{
		return cache::set($key, $val);
	}
	return cache::get($key);
}

class cache
{

	private static $store;

	static function set($key, $val)
	{
		self::$store[$key] = $val;
		return true;
	}

	static function get($key)
	{
		return self::$store[$key];
	}

	static function has($key)
	{
		return isset(self::$store[$key]);
	}

}

?>
